<?php
if (!isset($_SESSION['logged']) || $_SESSION['level'] != "admin"){
    print "<script language='javascript'>
        window.location.href='./?url=404';
        </script>";
}else {
    $idtype = $_GET['type'];
    $sql = "SELECT * FROM `type` WHERE `id` = '$idtype';";
    $result = mysql_query($sql, $link);
    $rowType = mysql_fetch_assoc($result);
?>
<div id="mainCol" class="clearfix">
    <h3 id="why">Edit type</h3>
    <ul id="maincon">
        <li class="clearfix last">
            <fieldset id="forms">
            <table width="100%">
                <form method="post" id="postform" action="?url=typeediting">
                    <input type="hidden" name="idtype" value="<?= $idtype; ?>">
                    <tr>
                        <td valign="top" width="15%"><b>Title:<b></td>
                        <td><input type="text" maxlength="50" name="title" id="f_input" size="55" value="<?= $rowType['title']; ?>" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input type="submit" id="f_submit" value="Save" /></td>
                    </tr>
                </form>
            </table>
            </fieldset>
        </li>
    </ul>
</div>
<?
}
?>
